<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
>
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
    <style type="text/css">

        /* tooltip */
        #tooltip{
            position:absolute;
            border:1px solid #ccc;
            background:#333;
            padding:2px;
            display:none;
            color:#fff;
        }
    </style>
</head>
<body>

<h1 class="xiadan">下单</h1>



<script src="__PUBLIC__/layui/layui.js" charset="utf-8"></script>
<script src="__PUBLIC__/jquery/jquery.min.js"></script>

<script type="text/javascript">
    layui.use('layer', function(){
        var layer = layui.layer;
        $('.xiadan').click(function () {
            $.post("{:url('api/pay/index')}",{},function (data) {
                var data= eval(data)
                console.log(data);

                window.location.href=data.result

            })

        })
    });

</script>

</body>
</html>
